<template>
  <div class="x-bar">
    <div :id="id"></div>
  </div>
</template>
<script>
import HighCharts from 'highcharts'

export default {
	// 验证类型
	props: {
		option: {
			type: Object
		}
	},
	data() {
		return {
			id: "highcharts_" + Math.floor(Math.random()*1000000)
		};
	},
	methods: {
		render() {
			HighCharts.chart(this.id, this.option);
		}
	},
	mounted() {
		this.render();
	},
	watch: {
		option: "render"
	}
}
</script>